//
//  YDStockSearchHeaderView.m
//  PeiZiWangBei
//
//  Created by LK-IOS on 2017/11/10.
//  Copyright © 2017年 LK-IOS. All rights reserved.
//

#import "YDStockSearchHeaderView.h"

@interface YDStockSearchHeaderView()

@end

@implementation YDStockSearchHeaderView

+ (instancetype)headerViewWithTableView:(UITableView *)tableView
{
    
    static NSString *stockSearchHeaderView = @"YDStockSearchHeaderView";
    YDStockSearchHeaderView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:stockSearchHeaderView];
    if (headerView == nil) {
        headerView = [[YDStockSearchHeaderView alloc] initWithReuseIdentifier:stockSearchHeaderView];
    }
    return headerView;
}


-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        [self titleLabel];
        
    }
    return self;
}

-(UILabel *)titleLabel
{
    if (_titleLabel == nil) {
        UILabel *titleLabel = [[UILabel alloc] init];
        [self.contentView addSubview:titleLabel];
        titleLabel.textColor = [UIColor colorWithHexString:blueyGrey];
        titleLabel.font = [UIFont systemFontOfSize:font12ScreenWRate * LKScreenW];
        titleLabel.textAlignment = NSTextAlignmentLeft;
        titleLabel.text = @"搜索结果:";
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(rate375(20));
            make.centerY.equalTo(self);
        }];
        _titleLabel = titleLabel;
    }
    return _titleLabel;
}

@end
